package org.port.contacts;

import java.util.Arrays;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;

public class ContactEntry {
	String mName;
	long mId;
	String mLookupKey;
	private String mPhoto_Thumb_Uri;
	private byte[] mPhoto;
	private Bitmap mPhotoThumbnail;

	public byte[] getmPhoto() {
		return mPhoto;
	}

	public void setmPhoto(byte[] mPhoto) {
		this.mPhoto = mPhoto;
		if (mPhoto != null) {
			BitmapFactory.Options options = new Options();
			options.inSampleSize = 4;
			Bitmap bitmap = BitmapFactory.decodeByteArray(mPhoto, 0,
					mPhoto.length);
			mPhotoThumbnail = bitmap;
			if (!bitmap.isRecycled()) {
				bitmap.isRecycled();
			}
		}
	}

	@Override
	public String toString() {
		return "ContactEntry [mName=" + mName + ", mId=" + mId
				+ ", mLookupKey=" + mLookupKey + ", mPhoto_Thumb_Uri="
				+ mPhoto_Thumb_Uri + ", mPhoto=" + Arrays.toString(mPhoto)
				+ "]";
	}

}